﻿using Albatross.WPF.Common.ViewModels;
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Albatross.SharePoint.Explorer.ViewModels {
	public class UserViewModel : ClientObjectViewModel {
		public UserViewModel(ClientContext context, string name, User user) : base(context, name, user) { }

		User User { get { return (User)ClientObject; } }

		public override string GetTreeItemTitle() {
			if (Name == string.Empty) {
				return User.Title;
			} else {
				return string.Format("{0} ({1})", Name, User.Title);
			}
		}

		public override string GetContentTitle() {
			if (Name == string.Empty) {
				return User.Title;
			} else {
				return string.Format("{0} ({1})", Name, User.Title);
			}
		}
	}
}
